//
// Created by yunnan xu on 2020/11/21.
//

#ifndef ANDROIDGRAPHICSDEMOS_MOBILEINPUT_H
#define ANDROIDGRAPHICSDEMOS_MOBILEINPUT_H

#include "Singleton.h"
#include "android_native_app_glue.h"
#include <EGL/egl.h>
#include <GLES3/gl32.h>
#include <functional>


class MobileInputMgr : public Singleton<MobileInputMgr>
{

public:

    void OnAInputEvent(const AInputEvent* event);

    void SetOnDiffX(std::function<void(float)> diff_x_func); // diff x
    void SetOnDiffY(std::function<void(float)> diff_y_func); // diff y
    void SetOnZoom(std::function<void(float, float, float)> zoom_func); // centerx, centery, 缩放比例
    void SetOnCancel(std::function<void()> cancel_func);

private:
    std::function<void(float)> diffXFunc;
    std::function<void(float)> diffYFunc;
    std::function<void(float, float, float)> zoomFunc;
    std::function<void()> cancelFunc;
};


#endif //ANDROIDGRAPHICSDEMOS_MOBILEINPUT_H
